package feizhou.untils.tools;

import javax.mail.internet.MimeMessage;

import org.apache.log4j.Logger;
import org.springframework.mail.javamail.JavaMailSenderImpl;

/**
 * @Description : 
 * @Autor : xiongjinpeng  jpx_011@163.com
 * @Date  : 2016年4月8日 上午11:11:54 
 * @version : 
 */
public class EmailThread extends Thread{
	private static Logger log = Logger.getLogger(EmailThread.class);
	private JavaMailSenderImpl javaMail;
	private MimeMessage message;
	
	public EmailThread(){
		
	}
	public EmailThread(JavaMailSenderImpl javaMail,MimeMessage message){
		this.javaMail=javaMail;
		this.message=message;
	}
	@Override
	public void run() {
		try {
			javaMail.send(message);
		} catch (Exception e) {
			log.error("send mail error", e);
		}
		
	}
}
